home *** CD-ROM | disk | FTP | other *** search
-
-
- #define appletinclude /*so other modules can tell if we've been included*/
-
-
- #ifndef appletdefsinclude
-
- #include "appletdefs.h"
-
- #endif
-
-
- #ifndef opsinclude
-
- #include "appletops.h"
-
- #endif
-
-
- #ifndef cursorinclude
-
- #include "appletcursor.h"
-
- #endif
-
-
- #ifndef mouseinclude
-
- #include "appletmouse.h"
-
- #endif
-
-
- #ifndef kbinclude
-
- #include "appletkb.h"
-
- #endif
-
-
- #ifndef memoryinclude
-
- #include "appletmemory.h"
-
- #endif
-
-
- #ifndef dialogsinclude
-
- #include "appletdialogs.h"
-
- #endif
-
-
- #ifndef quickdrawinclude
-
- #include "appletquickdraw.h"
-
- #endif
-
-
- #ifndef filesinclude
-
- #include "appletfiles.h"
-
- #endif
-
-
- #ifndef stringsinclude
-
- #include "appletstrings.h"
-
- #endif
-
-
- #ifndef fontinclude
-
- #include "appletfont.h"
-
- #endif
-
-
- #ifndef undoinclude
-
- #include "appletundo.h"
-
- #endif
-
-
- #ifndef frontierinclude
-
- #include "appletfrontier.h"
-
- #endif
-
-
- #ifndef paletteinclude
-
- #include "appletpalette.h"
-
- #endif
-
-
- #ifndef __IAC__
-
- #include <iac.h>
-
- #endif
-
-
- extern EventRecord appletevent; /*the last event received by appletmain.c*/
-
-
- typedef struct tyselectioninfo {
-
- boolean fldirty; /*something changed, menus need updating*/
-
- boolean flcansetfont; /*can we set font in current context?*/
-
- boolean flcansetsize; /*can we set size?*/
-
- boolean flcansetstyle; /*can we set style?*/
-
- boolean flcansetjust; /*can we set justification?*/
-
- boolean flcansetleading; /*can we set leading?*/
-
- short fontnum;
-
- short fontsize;
-
- short leading;
-
- boolean flplain;
-
- boolean flshadow;
-
- boolean floutline;
-
- boolean flunderline;
-
- boolean flitalic;
-
- boolean flbold;
-
- boolean flsubscript;
-
- boolean flsuperscript;
-
- boolean flextended;
-
- boolean flcondensed;
-
- tyjustification justification;
-
- short fontstyle; /*see setselectionstyleinfo*/
- } tyselectioninfo;
-
-
- typedef struct tyappwindow {
-
- bigstring fname;
-
- short vnum;
-
- short fnum;
-
- short windowvertpixels, windowhorizpixels;
-
- short defaultfont, defaultsize, defaultstyle;
-
- tyjustification defaultjustification;
-
- short fontheight;
-
- Handle appdata;
-
- Rect windowrect;
-
- Rect contentrect, oldcontentrect;
-
- Rect statusrect; /*the rectangle covering the status portion of window*/
-
- Rect updaterect; /*when an update event is in process, this is the dirty part of the window*/
-
- WindowPtr macwindow;
-
- hdlscrollbar vertbar, horizbar; /*the window's scrollbars*/
-
- boolean flmadechanges;
-
- boolean flresetscrollbars;
-
- boolean flcolorwindow;
-
- boolean flzoomed;
-
- boolean flprinting;
-
- short zoomheight, zoomwidth; /*set by getcontentsizecallback*/
-
- Point scrollorigin;
-
- tyselectioninfo selectioninfo;
-
- short forecolor, backcolor; /*indexes into the color lookup table*/
-
- short originpushdepth; /*see apppushorigin*/
-
- hdlpaletterecord hpalette; /*info about the palette for this window, nil if it has no palette*/
-
- Handle undostack, redostack;
- } tyappwindow, *ptrappwindow, **hdlappwindow;
-
-
- #define app1class 'app1'
-
- typedef boolean (*tyappcallback) (void);
-
- typedef boolean (*tyapphandleptrcallback) (Handle *);
-
- typedef boolean (*tyapphandlecallback) (Handle);
-
- typedef void (*tyapprectcallback) (Rect);
-
- typedef boolean (*tyappbooleancallback) (boolean);
-
- typedef boolean (*tyappshortcallback) (short);
-
- typedef boolean (*tyappsscrollcallback) (tydirection, boolean, short);
-
- typedef boolean (*tymenucallback) (short, short);
-
- typedef boolean (*tystringcallback) (bigstring);
-
-
-
-
- typedef struct typrintinfo {
-
- Rect paperrect;
-
- short vpagepixels; /*number of pixels on a page, vertically*/
-
- short ctpages; /*the number of pages in the document being printed*/
-
- Handle printhandle; /*a handle to the machine's print record*/
- } typrintinfo;
-
-
- typedef struct tyappletrecord {
-
- hdlappwindow appwindow; /*the frontmost applet window, callbacks work on this*/
-
- Handle appdata; /*a handle allocated by the applet to hold its data*/
-
- long filetype, creator; /*file type and creator for file saving*/
-
- sfcallback filefiltercallback; /*determines if files are displayed in stanard file dialog*/
-
- typrintinfo printinfo; /*for coordinating printing between applet and the shell*/
-
- short defaultfont, defaultsize, defaultstyle;
-
- boolean resizeable; /*if true the app's windows can be resized*/
-
- boolean eraseonresize; /*if true, the toolkit erases the window when it's resized*/
-
- boolean horizscroll; /*if true, the applet implements horiz scrolling*/
-
- boolean vertscroll; /*if true, the applet implements vert scrolling*/
-
- boolean haspalette; /*if true, the applet has an icon palette*/
-
- short ctpaletteicons; /*the number of icons in the palette*/
-
- boolean notsaveable; /*if true, the applet doesn't implement saving/opening files*/
-
- short statuspixels; /*height of status bar at top of window*/
-
- boolean usecolor; /*if true, we allocate a color window on color machines*/
-
- boolean exactcolors; /*if true, we use the palette manager to be sure you get exact colors*/
-
- boolean appmanagesfontmenus; /*if true, the toolkit doesn't insert font/size/style sub-menus*/
-
- tyappcallback newrecordcallback; /*allocate and initialize a new data handle*/
-
- tyappcallback disposerecordcallback; /*dealloc a data handle*/
-
- tyappcallback idlecallback; /*set mouse cursor, other "idle" stuff*/
-
- tyappbooleancallback activatecallback; /*activate or deactivate the window data*/
-
- tyappcallback updatecallback; /*update the display of the window data*/
-
- tyappcallback preupdatecallback; /*inval anything that needs inval'ing before an update*/
-
- tyappcallback windowresizecallback; /*recalc display data, adjust to new window size*/
-
- tyappcallback iacmessagecallback; /*process an IAC message*/
-
- tyappcallback iacfastmessagecallback; /*process a system event handler message*/
-
- tyapphandleptrcallback packcallback; /*pack memory structure into a disk handle*/
-
- tyapphandlecallback unpackcallback; /*unpack disk handle into memory structure*/
-
- tyapphandleptrcallback gettextcallback; /*return a handle of unformatted ASCII text*/
-
- tyapphandleptrcallback getpictcallback; /*return a Macintosh PicHandle of selected items*/
-
- tyappsscrollcallback scrollcallback;
-
- tyappcallback scrolltocallback;
-
- tyappcallback pagesetupcallback;
-
- tyappcallback openprintcallback;
-
- tyappshortcallback printpagecallback;
-
- tyappcallback closeprintcallback;
-
- tyapphandlecallback puttextcallback;
-
- tyapphandlecallback putpictcallback;
-
- tyappcallback haveselectioncallback;
-
- tyappcallback selectallcallback;
-
- tyappcallback keystrokecallback;
-
- tyappcallback mousecallback;
-
- tyappcallback mouseinstatuscallback;
-
- tyappcallback updatestatuscallback;
-
- tymenucallback menucallback;
-
- tyappcallback insertmenucallback;
-
- tyappcallback setselectioninfocallback;
-
- tyappcallback setfontcallback;
-
- tyappcallback setsizecallback;
-
- tyappcallback setstylecallback;
-
- tyappcallback setjustifycallback;
-
- tyapphandleptrcallback copycallback;
-
- tyappcallback clearcallback;
-
- tyapphandlecallback pastecallback;
-
- tyappcallback initmacintoshcallback;
-
- tyappbooleancallback resumecallback; /*suspend or resume the window*/
-
- tyapprectcallback eraserectcallback; /*color apps may want to override the default routine*/
-
- tyappcallback getcontentsizecallback; /*for apps that want to be smart about zooming*/
-
- tystringcallback opendoccallback; /*allow app to override 'odoc' Apple Event*/
-
- tyappcallback setglobalscallback; /*app can copy from app.appdata to its own globals*/
-
- tyapphandleptrcallback getoptionscallback;
-
- tyapphandlecallback putoptionscallback;
- } tyappletrecord, *ptrappletrecord, **hdlappletrecord;
-
-
- extern tyappletrecord app; /*global applet record, short name for easy access*/
-
-
-
- #ifndef scrollbarinclude
-
- #include "appletscrollbar.h"
-
- #endif
-
-
-
- void getdesktoprect (hdlappwindow, Rect *);
-
- boolean apppushwindow (hdlappwindow);
-
- boolean apppopwindow (void);
-
- boolean apppushorigin (void);
-
- boolean apppoporigin (void);
-
- boolean appopenbitmap (Rect, hdlappwindow);
-
- boolean appclosebitmap (hdlappwindow);
-
- boolean apppushclip (Rect r);
-
- boolean apppopclip (void);
-
- void appprecallback (void);
-
- void apppostcallback (void);
-
- boolean newappwindow (bigstring, boolean);
-
- void invalappwindow (hdlappwindow, boolean);
-
- void updateappwindow (hdlappwindow);
-
- void moveappwindow (hdlappwindow, Rect);
-
- boolean findbywindowtitle (bigstring, hdlappwindow *);
-
- boolean findnthwindow (short, hdlappwindow *);
-
- short countwindows (void);
-
- boolean findbyfile (bigstring, short, hdlappwindow *);
-
- boolean settargetglobals (void);
-
- boolean appalert (bigstring);
-
- boolean appconfirm (bigstring);
-
- boolean appask (bigstring, bigstring);
-
- void appletinitmanagers (void);
-
- void runapplet (void);
-
- boolean exitmainloop (void);
-
- boolean closefrontwindow (void);
-
- boolean initprint (void);
-
- boolean pagesetup (void);
-
- boolean printappwindow (hdlappwindow, boolean);
-
- boolean getprintinfo (void);
-
- pascal Boolean appscriptcomplete (void); /*call this when a script completes*/
-
- boolean visitappwindows (boolean (*) ());
-
- boolean invalallwindows (void);
-
- boolean eraseallwindows (void);
-
- void setappwindow (hdlappwindow);
-
- void apperaserect (Rect);
-
- boolean apprectneedsupdate (Rect);
-
- void appinvalstatusseparator (void);
-
- void drawappgrowicon (hdlappwindow);
-
-